package com.nice.entity;

import java.io.Serializable;

public class PriceSchema  implements Comparable, Serializable {

    private String indexName;

    private String ask;

    private String bid;

    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    public String getAsk() {
        return ask;
    }

    public void setAsk(String ask) {
        this.ask = ask;
    }

    public String getBid() {
        return bid;
    }

    public void setBid(String bid) {
        this.bid = bid;
    }

    @Override
    public String toString() {
        return "indexName="+indexName+","+
                "ask="+this.ask+","+
                "bid="+this.bid;
    }

    @Override
    public int compareTo(Object o) {

        if (o instanceof PriceSchema) {
            PriceSchema priceSchema = (PriceSchema) o;
            return this.indexName.compareTo(priceSchema.getIndexName());//换姓名升序排序
        }
        throw new ClassCastException("不能转换为PriceSchema类型的对象...");

    }

}
